/*
    Copyright 2011 - Tommi Laukkanen (www.substanceofcode.com)

    This file is part of MeeToDo.

    MeeToDo is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    MeeToDo is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with MeeToDo. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 1.1

Rectangle {
    id: toolbar
    color: "#000"
    y: parent.height - 60
    height: 60
    width: parent.width
    property bool showRemoveList: false

    signal back()
    signal showLists()
    signal removeList()
    signal removeTask()
    signal add()
    signal purge()

    Row {
        y: 6
        x: (parent.width - 48*4)/6
        width: parent.width - x*2
        spacing: (width - 48*4)/3

        ToolbarIcon {
            pic: "../pics/doc_delete.png"
            visible: toolbar.showRemoveList
            label: "Remove"
            onClicked: toolbar.back()
        }

        ToolbarIcon {
            pic: "../pics/delete.png"
            visible: listOfLists.state=="shown"
            label: "Quit"
            onClicked: Qt.quit()
        }

        ToolbarIcon {
            pic: "../pics/round_arrow_left.png"
            visible: listOfLists.state=="hidden"
            label: "Back"
            onClicked: toolbar.back()
        }

        ToolbarIcon {
            pic: "../pics/round_plus.png"
            visible: !paper.flipped
            label: "Add"
            onClicked: toolbar.add()
        }

        ToolbarIcon {
            pic: "../pics/round_checkmark.png"
            visible: !paper.flipped && listOfLists.state == "hidden"
            label: "Purge"
            onClicked: toolbar.purge()
        }

        ToolbarIcon {
            pic: "../pics/round_delete.png"
            visible: listOfLists.state=="hidden"
            label: "Remove"
            onClicked: {
                if(paper.flipped==false) {
                    toolbar.removeList();
                } else {
                    toolbar.removeTask();
                }
            }
        }

    }

}
